// 自动生成模板Comment
package hierarchy

import (
	"gitee.com/g-qs/gin-vue-admin/server/global"
	"gitee.com/g-qs/gin-vue-admin/server/model/user"
)

// Comment 结构体
type Comment struct {
	global.GVA_MODEL
	CreatedBy     *uint      `json:"createdBy" form:"createdBy" gorm:"column:created_by;comment:;"`
	CreatedUser   *user.User `json:"createdUser" form:"createdUser" gorm:"foreignKey:CreatedBy;references:ID;comment:;"`
	RootId        *int       `json:"rootId" form:"rootId" gorm:"column:root_id;comment:目标id;"`
	RootType      string     `json:"rootType" form:"rootType" gorm:"column:root_type;comment:音频|视频|文章|评论;"`
	CommentId     *int       `json:"commentId" form:"commentId" gorm:"column:comment_id;comment:;"` // 回复的评论id
	TargetComment *Comment   `json:"targetComment" form:"targetComment" gorm:"foreignKey:CommentId;references:ID;comment:;"`
	CommentInfo   string     `json:"commentInfo" form:"commentInfo" gorm:"column:comment_info;comment:;"`
	Total         int64      `json:"total" form:"total" gorm:"column:total;comment:;"`
}

// TableName Comment 表名
func (Comment) TableName() string {
	return "fd_comment"
}
